package indzcraft.ui;

import java.beans.Beans;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class Settings extends Beans {
	
	private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
	
	int talents = 1;
	
	public void setTalents(int t) {
		int oldT = talents;
		talents = t;
		pcs.firePropertyChange("talents", oldT, t);
	};
	public int getTalents() { return talents; };
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener pcl)
    {
		pcs.addPropertyChangeListener(pcl);
    }

	public synchronized void removePropertyChangeListener(PropertyChangeListener pcl)
	{
		pcs.removePropertyChangeListener(pcl);
	}
    
    public final void propertyChange(PropertyChangeEvent event)
    {
    	System.out.println(event.getPropertyName());
    	if(event.getPropertyName()=="talents")
    	{
    		System.out.println("hi");
    	}
	}
}
